package com.dataart.productshop.service.impl;

import com.dataart.productshop.dao.TypeDao;
import com.dataart.productshop.model.Type;
import com.dataart.productshop.service.TypeManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("typeManager")
@Transactional
public class TypeManagerImpl extends BaseManagerImpl<Type> implements TypeManager{

	private TypeDao typeDao; //TODO: remove. this dao has to be already incapsulated in BaseManagerImpl
	
	@Autowired
	public void setTypeDao(TypeDao typeDao){
		this.typeDao = typeDao;
		setBaseDao(typeDao);
	}
	
	@Override
	public void saveType(Type type) {
		typeDao.save(type);
		
	}

	@Override
	public Type getTypeById(Long id) {
		return typeDao.getById(id);
	}

}
